package com.app.system.config.jwt;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * Created by WCF on 2020/5/10.
 */
@SuppressWarnings("all")
public class JwtToken extends UsernamePasswordToken {

    private String token;

    public JwtToken(String token) {
        this.token = token;
    }

    public JwtToken(String username, String password, boolean rememberMe) {
        super(username, password, rememberMe);
    }

    @Override
    public Object getPrincipal() {
        if (token == null || token.equals("")) {
            return super.getPrincipal();
        } else {
            return token;
        }
    }

    @Override
    public Object getCredentials() {
        if (token == null || token.equals("")) {
            return super.getCredentials();
        } else {
            return token;
        }

    }
}
